<template>
	<div id="container"></div>

</template>

<script>
	import AMapLoader from "@amap/amap-jsapi-loader";
	export default {
		name: 'MapContainer',
		data() {
			return {
				map: null, // 初始化地图对象,
			};
		},
		methods: {
			initAMap() {
				window._AMapSecurityConfig = {
					securityJsCode: "e4c94b1d8e7273256a0f0719f7ed95cd",
				};
				AMapLoader.load({
						key: "f729761582d8095920945aeaafadeec9",
						version: "2.0",
						plugins: ["AMap.Scale"], 
					})
					.then((AMap) => {
						this.map = new AMap.Map("container", {
							viewMode: "3D",
							zoom: 11,
							center: [116.397428, 39.90923],
						});
					})
					.catch((e) => {
						console.log('2',e);
					});
			},
		},
		mounted() {
			this.initAMap();
		}
	};
</script>

<style scoped>
	#container {
	width: 100%;
	height: 700px;
	}
</style>